package cn.com.server.service.impl;

import cn.com.server.dao.TerminalDao;
import cn.com.server.entity.Terminal;
import cn.com.server.service.TerminalService;
import cn.com.server.extend.model.TerminalModel;
import cn.com.server.extend.view.TerminalView;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;

/**
 * <p>
 * 终端表 服务实现类
 * </p>
 *
 * @author qing
 * @since 2017-11-20
 */
@Service
public class TerminalServiceImp implements TerminalService {
	
	@Autowired
	private TerminalDao dao;
	
	@Override
	public int insert(Terminal entity) {
		return dao.insert(entity);
	}
	
	@Override
	public int update(Terminal entity) {
		return dao.update(entity);
	}
	
	@Override
	public Page<TerminalView> selectTerminalViewList(TerminalModel model){
		PageHelper.startPage(model.getPage(), model.getLimit());
		Page<TerminalView> pageData = dao.selectTerminalViewList(model);
		return pageData;
	}
	
}
